import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../mianjing/Login.vue';
import Layout from '../mianjing/Layout.vue';
import Register from '../mianjing/Register.vue';
import Home from '../mianjing/Suv/Houe.vue';
import Collect from '../mianjing/Suv/Collect.vue';
import Love from '../mianjing/Suv/Love.vue';
import My from '../mianjing/Suv/My.vue';
import Datail from '../mianjing/Datail.vue';



Vue.use(VueRouter)

/* 路由规则 */
const routes = [
   
     {
      path:'/login', //路由值
      name:'login',
      component:Login
     },
    
    {
      path:'/register',
      name:'register',
      component:Register
    },
    {
      path:'/datail/:id',
      name:'datail',
      component:Datail
    },
    {
      path:'/layout',
      name:'layout',
      component:Layout,
      redirect:'/layout/home',
      children:[
        {
          path:'home',
          name:'首页',
          component:Home
        },
        {
          path:'collect',
          name:'收藏',
          component:Collect
        },
        {
          path:'love',
          name:'喜欢',
          component:Love
        },
        {
          path:'my',
          name:'我的',
          component:My
        },
      ]
    },
    

]

const router = new VueRouter({
  mode:'hash', //配置路由模式
  routes:routes
})

export default router
